[XM] Print qualified path to config file on domain creation.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 23 Oct 2006 11:43:32 +0000 (12:43 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 23 Oct 2006 11:43:32 +0000 (12:43 +0100)
From: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/xm/opts.py

index 189875d55e806ceed90dd09210fe14f343d0f1db..1eac629aa1f23ed8a9b46112c5c93900c5bcc558 100644 (file)
@@ -488,6 +488,8 @@ class Opts:
                 p = os.path.join(x, self.vals.defconfig)
             else:
                 p = self.vals.defconfig
+            if not p.startswith('/'):
+                p = os.path.join(os.path.curdir, p)
             if os.path.exists(p):
                 self.info('Using config file "%s".' % p)
                 self.load(p, help)
@@ -518,6 +520,10 @@ class Opts:
         exec cmd in globs, locs
         try:
             execfile(defconfig, globs, locs)
+        except SyntaxError,e:
+                raise SyntaxError, \
+                "Errors were found at line %d while processing %s:\n\t%s"\
+                %(e.lineno,defconfig,e.text)
         except:
             if not help: raise
         if help: